import React, { useEffect } from 'react';
import { ScrollView } from 'react-native';

import styles from './style';
import QueryHeader from './QueryHeader';
import QueryNav from './QueryNav';
import QueryHelp from './QueryHelp';
import QueryCarPro from './QueryCarPro';
import QueryRecommend from './QueryRecommend';
import QueryBanner from './QueryBanner';

function QueryScreen(props) {
  const { queryDate, getQueryDateSaga } = props;

  useEffect(() => {
    getQueryDateSaga();

    return () => {};
  }, [getQueryDateSaga]);

  console.log(queryDate, 'queryDate');

  return (
    <ScrollView style={styles.queryContainer}>
      {/* 查询header */}
      <QueryHeader />

      {/* banner */}
      <QueryBanner />

      {/* 导航 */}
      <QueryNav />

      {/* 急需帮助 */}
      <QueryHelp />

      {/* 汽车用品 */}
      <QueryCarPro />

      {/* 今日推荐 */}
      <QueryRecommend />
    </ScrollView>
  );
}

export default QueryScreen;
